// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_PUR_RFQ_ITEM
// * CreateDate    : 2014-06-05 18:30:27
// * Creater       : CodeSmith
// * LastChangeDate: 2014-06-05 18:30:27
// * LastChanger   : 2014-06-05 18:30:27
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;
using ESOL.Common;

namespace ESOL.Common.Entity
{
    [DataContract]
	[Serializable]
	public partial class PurRfqItemEntity : EntityBase
    {
        public PurRfqItemTable TableSchema
        {
            get
            {
                return PurRfqItemTable.Current;
            }
		}
		
		public PurRfqItemEntity()
        {

        }
		
		public PurRfqItemEntity(DataRow dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.RfqNo = Convert.ToString(CommonFunctions.ToObject(dr["RFQ_NO"]));
			this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
			this.Unit = Convert.ToString(CommonFunctions.ToObject(dr["UNIT"]));
			this.TaxRate = Convert.ToDecimal(CommonFunctions.ToObject(dr["TAX_RATE"]));
			this.Price = Convert.ToDecimal(CommonFunctions.ToObject(dr["PRICE"]));
			this.MaxPrice = Convert.ToDecimal(CommonFunctions.ToObject(dr["MAX_PRICE"]));
			this.MinPrice = Convert.ToDecimal(CommonFunctions.ToObject(dr["MIN_PRICE"]));
			this.MaterialId = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_ID"]));
			this.MaterialName = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_NAME"]));
			this.MaterialCode = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_CODE"]));
			this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
        }
		
		public PurRfqItemEntity(DataRowView dr)
        {
			if(dr == null)
			{
				return;
			}
			this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
			this.RfqNo = Convert.ToString(CommonFunctions.ToObject(dr["RFQ_NO"]));
			this.Qty = Convert.ToDecimal(CommonFunctions.ToObject(dr["QTY"]));
			this.Unit = Convert.ToString(CommonFunctions.ToObject(dr["UNIT"]));
			this.TaxRate = Convert.ToDecimal(CommonFunctions.ToObject(dr["TAX_RATE"]));
			this.Price = Convert.ToDecimal(CommonFunctions.ToObject(dr["PRICE"]));
			this.MaxPrice = Convert.ToDecimal(CommonFunctions.ToObject(dr["MAX_PRICE"]));
			this.MinPrice = Convert.ToDecimal(CommonFunctions.ToObject(dr["MIN_PRICE"]));
			this.MaterialId = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_ID"]));
			this.MaterialName = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_NAME"]));
			this.MaterialCode = Convert.ToString(CommonFunctions.ToObject(dr["MATERIAL_CODE"]));
			this.Remark = Convert.ToString(CommonFunctions.ToObject(dr["REMARK"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return PurRfqItemTable.Current;
            }
        }
		
		#region Perporty List
        [DataMember]
        public string Id
        {
            get { return Convert.ToString(GetData(PurRfqItemTable.C_ID)); }
            set { SetData(PurRfqItemTable.C_ID, value); }
        }
		
        [DataMember]
        public string RfqNo
        {
            get { return Convert.ToString(GetData(PurRfqItemTable.C_RFQ_NO)); }
            set { SetData(PurRfqItemTable.C_RFQ_NO, value); }
        }
		
        [DataMember]
        public decimal Qty
        {
            get { return Convert.ToDecimal(GetData(PurRfqItemTable.C_QTY)); }
            set { SetData(PurRfqItemTable.C_QTY, value); }
        }
		
        [DataMember]
        public string Unit
        {
            get { return Convert.ToString(GetData(PurRfqItemTable.C_UNIT)); }
            set { SetData(PurRfqItemTable.C_UNIT, value); }
        }
		
        [DataMember]
        public decimal TaxRate
        {
            get { return Convert.ToDecimal(GetData(PurRfqItemTable.C_TAX_RATE)); }
            set { SetData(PurRfqItemTable.C_TAX_RATE, value); }
        }
		
        [DataMember]
        public decimal Price
        {
            get { return Convert.ToDecimal(GetData(PurRfqItemTable.C_PRICE)); }
            set { SetData(PurRfqItemTable.C_PRICE, value); }
        }
		
        [DataMember]
        public decimal MaxPrice
        {
            get { return Convert.ToDecimal(GetData(PurRfqItemTable.C_MAX_PRICE)); }
            set { SetData(PurRfqItemTable.C_MAX_PRICE, value); }
        }
		
        [DataMember]
        public decimal MinPrice
        {
            get { return Convert.ToDecimal(GetData(PurRfqItemTable.C_MIN_PRICE)); }
            set { SetData(PurRfqItemTable.C_MIN_PRICE, value); }
        }
		
        [DataMember]
        public string MaterialId
        {
            get { return Convert.ToString(GetData(PurRfqItemTable.C_MATERIAL_ID)); }
            set { SetData(PurRfqItemTable.C_MATERIAL_ID, value); }
        }
		
        [DataMember]
        public string MaterialName
        {
            get { return Convert.ToString(GetData(PurRfqItemTable.C_MATERIAL_NAME)); }
            set { SetData(PurRfqItemTable.C_MATERIAL_NAME, value); }
        }
		
        [DataMember]
        public string MaterialCode
        {
            get { return Convert.ToString(GetData(PurRfqItemTable.C_MATERIAL_CODE)); }
            set { SetData(PurRfqItemTable.C_MATERIAL_CODE, value); }
        }
		
        [DataMember]
        public string Remark
        {
            get { return Convert.ToString(GetData(PurRfqItemTable.C_REMARK)); }
            set { SetData(PurRfqItemTable.C_REMARK, value); }
        }
		
		#endregion
	}
	
	
}	

